home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / ACGIFREE.ZIP / INCLUDE / A_FORM.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-04  |  2.0 KB  |  58 lines

  1. ///////////////////////////////////////////////////////////////////////////////////
  2. // AFormItem - node to a linked list to contain the form Value
  3. ///////////////////////////////////////////////////////////////////////////////////
  4. class AFormItem : public APairItem
  5. {
  6.   public: 
  7.     AFormItem(AFormItem *pfiSource = NULL)
  8.     {
  9.       if (pfiSource)
  10.         _bCopy(*pfiSource);               //a_Copy the form item
  11.     }
  12.     
  13.     virtual ~AFormItem() {}
  14.  
  15.     //a_Declares debug/dump related functions
  16.     #ifdef _DEBUG_DUMP_
  17.       void dump(void);     //a_Debugging dump, when _DEBUG_DUMP_ is set
  18.     #endif
  19.  
  20.     //a_FORM specific parsing, NAME=VALUE format with URL encoding
  21.     int fiSetAndParse(const char *pccItem);         //a_Parses the input NAME=VALUE type
  22.  
  23.   protected:
  24.     void _bCopy(const AFormItem &fiSource);
  25. };
  26.  
  27. ///////////////////////////////////////////////////////////////////////////////////
  28. // AFormList class
  29. ///////////////////////////////////////////////////////////////////////////////////
  30. class AFormList : public APairList
  31. {
  32.   public:
  33.     AFormList() {}
  34.     virtual ~AFormList() {}
  35.  
  36.     //a_Declares debug/dump related functions
  37.     #ifdef _DEBUG_DUMP_
  38.       void dump(void);     //a_Debugging dump, when _DEBUG_DUMP_ is set
  39.     #endif
  40.  
  41.     //a_ABaseElement pure virtual override
  42.     virtual void doOut(AStreamOutput *pasOut) const
  43.       { doPairs(pasOut, '&', INT_MAX, 0x0, 0x1); }
  44.  
  45.     //a_AFormItem list generation, returns the count of items
  46.     int flGenerateList(istream *pisInput, int iContentLength);  //a_Stream processing
  47.     int flGenerateList(const char *pccInput);                   //a_String processing
  48.  
  49.     //a_List manipulators, if replace is set, only one VALUE per NAME, else many can exist
  50.     AFormItem *flAddItem(const char *pccItem, int iReplace = 0x0);                        //a_Adds to the end of the list with parsing of NAME=VALUE
  51.  
  52.   protected:
  53.     void _bCopy(const AFormList &flSource);
  54.  
  55.     int _flProcessInput(istrstream *pssInput, int iContentLength);
  56.  
  57. };
  58.